package com.dyypdadmin.service.impl;

import com.dyypdadmin.dao.MedicalRecordsDao;
import com.dyypdadmin.pojo.MedicalRecords;
import com.dyypdadmin.service.MedicalRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MedicalRecordsServiceImpl implements MedicalRecordsService {
    @Autowired
    private MedicalRecordsDao medicalRecordsDao;

    @Override
    public int addMedicalRecord(String order_number, Integer user_id, String diagnosis_result, Integer is_medication_required, String medication_details, String doctor_advice) {
        return medicalRecordsDao.addMedicalRecord(order_number, user_id, diagnosis_result, is_medication_required, medication_details, doctor_advice);
    }

    @Override
    public List<MedicalRecords> getByUserId(Integer user_id) {
        return medicalRecordsDao.getByUserId(user_id);
    }

    @Override
    public List<MedicalRecords> getAll() {
        return medicalRecordsDao.selectList(null);
    }

    @Override
    public List<MedicalRecords> getAllMedicalRecordByOrderNumbergetAllMedicalRecord(String order_number) {
        return medicalRecordsDao.getAllMedicalRecordByOrderNumbergetAllMedicalRecord(order_number);
    }

    @Override
    public int getMedicalRecordsCounts() {
        return medicalRecordsDao.getMedicalRecordsCounts();
    }

    @Override
    public List<MedicalRecords> getAllMedicalRecordsByPetId(Integer pet_id) {
        return medicalRecordsDao.getAllMedicalRecordsByPetId(pet_id);
    }
}
